@import "../../../base.less";

@import "./_var.less";

.@{toast} {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12001;
  opacity: 1;
  transition: opacity 300ms ease;
  background-color: @toast-bg-color;
  border-radius: @toast-radius;
  font-size: 14px;
  color: @toast-color;
  max-width: @toast-max-width;
  width: fit-content;
  box-sizing: border-box;

  &--column {
    padding: 24px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &--loading&--with-text {
    min-width: 102px;
    min-height: 102px;
    padding-top: 0;
    padding-bottom: 0;
  }

  &__content {
    align-items: center;
    line-height: 22px;

    &--row {
      display: flex;
      text-align: left;
      padding: 14px 22px;
    }

    &--column {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
    }
  }

  &__icon {
    &--row {
      display: flex;
      font-size: @toast-row-icon-size;
    }

    &--column {
      font-size: @toast-column-icon-size;
    }
  }

  &__text {
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;
    /* stylelint-disable-next-line */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    white-space: pre-line;

    &--column:not(:empty):not(:only-child) {
      margin-top: 8px;
      min-width: 64px;
    }

    &--row:not(:empty):not(:only-child) {
      margin-left: 8px;
    }
  }

  &.@{prefix}-fade-enter,
  &.@{prefix}-fade-leave-to {
    opacity: 0;
  }

  &-overflow-hidden {
    overflow: hidden;
    cursor: not-allowed;

    * {
      pointer-events: none;
    }
  }
}
